
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Bootstrap Dashboard</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <!-- Fontastic Custom icon font-->
    <link rel="stylesheet" href="css/fontastic.css">
    <!-- Google fonts - Roboto -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
    <!-- jQuery Circle-->
    <link rel="stylesheet" href="css/grasp_mobile_progress_circle-1.0.0.min.css">
    <!-- Custom Scrollbar-->
    <link rel="stylesheet" href="css/jquery.mCustomScrollbar.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="img/1.ico">
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/jquery.min-1.8.3.js"></script>
    <!-- Tweaks for older IEs--><!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>-->

</head>

<body>

<div class="page login-page">
    <div class="container">
        <div class="form-outer text-center d-flex align-items-center">
            <div class="form-inner">
                <div class="logo text-uppercase">
                    <strong class="text-primary">
                         登录<br>
                        ${requestScope.err}
                </strong></div>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
                <form method="post" class="text-left form-validate" action="UserLogin.do">
                    <input type="radio" id="s" value="s" name="st"/>学生
                    <input type="radio" id="t" value="t" name="st"/>老师
                    <div class="form-group-material">
                        <input id="username" type="text"  name="username" value="${cookie.username.value}" required data-msg="请输入你的用户名" class="input-material">
                        <label  class="label-material">用户名</label>
                    </div>
                    <div class="form-group-material">
                        <input id="login-password" type="password" name="password" value="${cookie.password.value}"  required data-msg="请输入你的密码" class="input-material">
                        <label for="login-password" class="label-material">密码</label>
                    </div>
                    <div id="v_container" style="width: 140px;height: 50px; float: right; margin-top: 10px; border: 5px solid #dedede; "></div>
                    </br>
                    <div ><input type="text" id="code_input" value="" placeholder="请输入验证码" style="width: 120px;"/></div></br>
                    <div class="form-group text-center">
                        <div style="float: left; margin-left: -10px; ">
                        <input type="checkbox" id="cd" name="cd"  class="form-check-input"><span>记住密码</span></div>
                        <input type="button" id="login"  onclick="on_form(this.form)" class="btn btn-primary" value="登录" style="margin-left: -40px"/>

                        <!-- This should be submit button but I replaced it with <a> for demo purposes-->
                    </div>
                </form>  <a href="#" class="forgot-pass">忘记密码?</a><small>还没有账号吗?快来 </small><a href="register.jsp" class="signup">注册</a>
            </div>
        </div>
    </div>
</div>



<!-- JavaScript files-->
<script type="text/javascript"  src="js/jquery.min.js"></script>
<script type="text/javascript"  src="js/popper.min.js"> </script>
<script type="text/javascript"  src="js/bootstrap.min.js"></script>
<script type="text/javascript"  src="js/grasp_mobile_progress_circle-1.0.0.min.js"></script>
<script type="text/javascript"  src="js/jquery.cookie.js"> </script>
<script type="text/javascript"  src="js/Chart.min.js"></script>
<script type="text/javascript"  src="js/jquery.validate.min.js"></script>
<script type="text/javascript"  src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Main File-->
<script type="text/javascript"  src="js/front.js"></script>
<script type="text/javascript" src="js/gVerify.js"></script>

<script type="text/javascript">
    var verifyCode = new GVerify("v_container");

    function on_form (f){
        var res = verifyCode.validate(document.getElementById("code_input").value);
        if(res){
            var s= document.getElementById("s");
            var t= document.getElementById("t");
            if(s.checked==false & t.checked==false){
                alert("未选中登录者身份")
            }
            else{
                $(f).submit();
            }
        }else{
            alert("验证码错误");
        }
    }
</script>
</body>

<script type="text/javascript">
    var username= $('#username').val();
    if (username !=""){
        var cd = document.getElementById("cd");
        cd.checked=true;
    }

</script>
</html>
